//
//  LeftMenu.m
//  AloTruyen
//
//  Created by vominhthong on 10/5/14.
//  Copyright (c) 2014 Khoai Nguyen Minh. All rights reserved.
//

#import "LeftMenu.h"

@implementation LeftMenu
-(instancetype)initLeftMenuWithDictionary:(NSDictionary *)params{
    if (self = [super init]) {
        self.nameAuthor = params[@"name"];
        self.specID = Str4Fmt(@"%@", params[@"spec_id"]);
        self.count = params[@"count"];
        if ([self.count integerValue] > 0) {
            self.titleLeftMenu = Str4Fmt(@"%@ (%@)", self.nameAuthor,@([self.count integerValue]));
        }else{
            self.titleLeftMenu = self.nameAuthor;
        }
        
        /* setup gioi thieu sach moi */
        if ([params[@"name"] isEqualToString:@"new_book"]) {
            NotifPost2Obj(@"kListEntity",params[@"list_entity"] );
        }
    }
    return self;
}
@end
